﻿// --------------------------------
// <copyright file="GraphAPIObjects2.cs" company="Samaj Shekhar">
//     Copyright (c) 2010-2011 Samaj Shekhar
// </copyright>
// <author>Samaj Shekhar (samaj.shekhar@hotmail.com)</author>
// <license>Released under the terms of the Microsoft Public License (Ms-PL)</license>
// <website>http://thesharepage.codeplex.com</website>
// ---------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SharePage.CoreLib.Facebook.GraphAPIObjects;

namespace SharePage.CoreLib.Facebook.GraphAPIObjects
{
    /// <summary>
    /// <para>This fecebook user class represents the user object returned by facebook on a Graph API call to</para>
    /// <para>http://graph.facebook.com/[userid|username]</para> 
    /// <para>Without using a access token</para>
    /// </summary>
    /// <remarks>
    /// Copyright: Copyright (c) 2010-2011 Samaj Shekhar
    /// Last Update: 31-Dec-2010|07:48am
    /// </remarks>
    [Serializable]
    public class FacebookUserWithoutAccessToken
    {
        /// <summary>
        /// The user's facebook Unique ID
        /// </summary>
        public string id { get; set; }// Notice although user ID is a string as mentioned in Decumentaion try converting it to long do facilitate indexing in database.

        /// <summary>
        /// The user's Name
        /// </summary>
        public string name { get; set; }

        /// <summary>
        /// The user's first name
        /// </summary>
        public string first_name { get; set; }

        /// <summary>
        /// The user's Last name
        /// </summary>
        public string last_name { get; set; }

        /// <summary>
        /// The user's link to Profile on facebook
        /// </summary>
        public Uri link { get; set; }

        /// <summary>
        /// The user's gender
        /// </summary>
        public string gender { get; set; }

        /// <summary>
        /// The user's locale in an ISO language code and ISO Country code like en_US
        /// </summary>
        public string locale { get; set; }
    }

    /// <summary>
    /// <para>This fecebook user class represents the user object returned by facebook on a Graph API call to</para>
    /// <para>http://graph.facebook.com/[userid|username]/[accesstoken]</para> 
    /// <para>With a valid access token</para>
    /// </summary>
    /// <remarks>
    /// Copyright: Copyright (c) 2010-2011 Samaj Shekhar
    /// Last Update: 31-Dec-2010|08:20am
    /// </remarks>
    public class FacebookUser : FacebookUserWithoutAccessToken
    {
        /// <summary>
        /// The user's about me blurb
        /// </summary>
        public string about { get; set; }

        /// <summary>
        /// User's bio in place of about blurb
        /// </summary>
        public string bio { get; set; }

        /// <summary>
        /// The user's birth date as a string
        /// </summary>
        public string birthday { get; set; }//Facebook stores this date as a string

        /// <summary>
        /// The user's Home town
        /// </summary>
        public NameIdPair hometown { get; set; }
        
        /// <summary>
        /// The user's work history as an array
        /// </summary>
        public FacebookUserWorkHistory[] work { get; set; }

        /// <summary>
        /// The user's mentioned sports
        /// </summary>
        public NameIdPair[] sports { get; set; }

        /// <summary>
        /// The user's favourite team. Name is team name and ID is Team Page ID
        /// </summary>
        public NameIdPair[] favourite_teams { get; set; }

        /// <summary>
        /// The user's education details
        /// </summary>
        public FacebookUserEducation[] education { get; set; }

        /// <summary>
        /// The languages known by user, Name is Language and ID is the page or community id
        /// </summary>
        public NameIdPair[] languages { get; set; }

        /// <summary>
        /// The user's Email
        /// </summary>
        public string email { get; set; }

    }

    //TODO: Didn't have time to document things so will do them later. This point on i havent mentioned any documentaion

    public class FacebookUserWorkHistory
    {
        public NameIdPair employer { get; set; }
        public NameIdPair location { get; set; }
        public NameIdPair[] with { get; set; }
        public string start_date { get; set; }
        public FacebookUserWorkHistoryProjects[] projects { get; set; }
    }
    
    public class FacebookUserWorkHistoryProjects
	{
        public string id { get; set; }
        public string name { get; set; }
        public NameIdPair[] with { get; set; }
        public string description { get; set; }
        public string start_date { get; set; }
	}

    public class FacebookUserEducation
    {
        public NameIdPair school { get; set; }
        public NameIdPair year{ get; set; }
        public NameIdPair[] concentration { get; set; }
        public string type { get; set; }
        public FacebookUserClassSubjects[] classes { get; set; }
    }

    public class FacebookUserClassSubjects
    {
        public string id { get; set; }
        public string name { get; set; }
        public NameIdPair[] with { get; set; }
    }

    public class FacebookFriends
    {
        public NameIdPair[] data { get; set; }
    }
}
